<template>
    <div class="header">
        <el-input v-model="input"/>
        <el-button type="success" plain @click="submit">点击提交</el-button>
    </div>
</template>

<script lang="ts">
import { defineComponent ,ref} from 'vue'

export default defineComponent({
    setup (props,{emit}) {
        let input = ref('');
        function submit(){
            emit('addInfo',input.value);
            input.value = '';
        }
        return {
            input,
            submit
        }
    }
})
</script>

<style scoped>
.el-input{
    margin: 0 10px;
    width: 200px;
}
.header{
    border-bottom: 1px solid black;
}
</style>